from socket import *

ClientSocket = socket(AF_INET, SOCK_STREAM)#创建套接字模拟浏览器发送请求
ClientSocket.connect(('localhost', 12000))     #将套接字与端口号绑定起来

while True:
    msg = input("Input Message：")#输入信息
    ClientSocket.send(msg.encode())#发送输入的信息
    data = ClientSocket.recv(1024)#接收服务器返回的信息
    print("Accepted", data.decode())#输出接收到的信息